package game.graphics.lighting
{
	import away3d.core.managers.*;
	import engine.core.*;
	import engine.graphics.away3d.*;
	import engine.graphics.lighting.*;
	import engine.graphics.shader.*;
	import engine.graphics.vfx.*;
	import engine.loaders.*;

	public class RxWorldLightFX extends RxWorldBaseFX
	{
		private var m_pointLight:RxPointLight;
		private var m_pointLightMesh:RxPointLightMesh;
		private static var s_pool:RxObjectPool = null;
		
		public function RxWorldLightFX(light:RxPointLight, mesh:RxPointLightMesh)
		{
			InitLightFX(light, mesh);
		}
		
		private function InitLightFX(light:RxPointLight, mesh:RxPointLightMesh) : void
		{
			if (this.m_pointLight == null)
			{
				this.m_pointLight = new RxPointLight();
			}
			if (light != null)
			{
				this.m_pointLight.Copy(light);
			}
			this.m_pointLightMesh = mesh;
		}
		
		public static function CreatePool(initSize:uint, growSize:uint) : void
		{
			var allocFunc:* = function () : Object
			{
				return new RxWorldLightFX(null, null);
			};
			
			s_pool = new RxObjectPool(allocFunc, null, initSize, growSize, RxWorldLightFX);
		}
	}
}